/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2021-2021.
 * Description: for undefinstr and memabort enhance feature to declare
 *              some variables and functions.
 * Author: huangshaobo
 * Create: 2021-01-26
 */

#ifndef RTOS_EXCEPTION_ENHANCE_H
#define RTOS_EXCEPTION_ENHANCE_H

#ifdef CONFIG_RTOS_KBOX
extern unsigned int exception_enhance_log_size;
extern int proc_exception_enhance_log_size(struct ctl_table *table,
	int write, void __user *buffer,	size_t *lenp, loff_t *ppos);
#endif
#if defined(CONFIG_X86_64)
#define GET_EXCEPTION_TYPE(tsk) (tsk->thread.trap_nr)
#endif
extern int show_exception_enhance;

#ifdef CONFIG_RTOS_DEBUG_EXCEPTION_ENHANCE
extern void rtos_exception_dump_pagetable(struct task_struct *tsk,
	bool is_user_mode, unsigned long pc, unsigned long mode, int sig);
#else
static inline void rtos_exception_dump_pagetable(struct task_struct *tsk, bool is_user_mode,
				   unsigned long pc, unsigned long mode,
				   int sig)
{
}
#endif

#endif
